package g4p.tests;

import g4p_controls.GButton;
import g4p_controls.GEvent;

import processing.core.PApplet;

public class ButtonEvents extends PApplet {

	GButton myButton;

	public void setup() {
	  size(300, 300);
	  myButton = new GButton(this, 20, 30, 100, 20, "Test");
	  myButton.fireAllEvents (true);
	}


	public void draw() {
	}

	public void handleButtonEvents(GButton button, GEvent event) {
	  if (myButton == button) {
	    switch(event) {
	    case CLICKED:
	      println("Clicked");
	      break;
	    case PRESSED:
	      println("Pressed");
	      break;
	    case RELEASED:
	      println("Relaesed");
	      break;
	    }
	  }
	  
	}

}
